//
//  BaseNavigationController.m
//  JKWDStudent
//
//  Created by 学大教育 on 2022/1/9.
//

#import "BaseNavigationController.h"

@interface BaseNavigationController ()<UIGestureRecognizerDelegate,UINavigationControllerDelegate>

@end

@implementation BaseNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)popToNearestController:(NSArray *)controllerNames animated:(BOOL)animated
{
    UIViewController *theController = nil;
    for (UIViewController *controller in [self.navigationController.viewControllers reverseObjectEnumerator])
    {
        for (NSString *name in controllerNames) {
            Class class = NSClassFromString(name);
             if ([controller isKindOfClass:class])
             {
                 theController = controller;
                 break;
             }
        }
        if (theController) {
            break;
        }
    }
    if (theController) {
        [self popToViewController:theController animated:animated];
    }
    
}
// 重写父类方法

- (UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleDefault;
}



- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
    
    if (self.viewControllers.count > 0) {
        viewController.hidesBottomBarWhenPushed = YES;
    }
    
    if (self.viewControllers.count) {
        
        if (self.viewControllers.count <= 1) {

        } else {

            
        }
        
    }

    [super pushViewController:viewController animated:animated];


}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
